home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / T-Z / Windoids.cpt / Windoid 1.7 / card_2651.txt < prev    next >
Text File  |  1989-04-19  |  5KB  |  78 lines

  1. -- card: 2651 from stack: in.7
  2. -- bmap block id: 3069
  3. -- flags: 0000
  4. -- background id: 10029
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 11
  9. ----- text -----
  10. ‚Ä¢ 1) In earlier WINDOIDs, I mentioned that you can get a bit-mapped miniature of your Card by copying the card, then doing a CMD-Shift-Paste.  However, to do this automatically through HyperTalk, you should try:
  11.  
  12. DoMenu  "Copy Card"
  13. type "v" with commandKey,shiftKey
  14.  
  15. ‚Ä¢ 2) Here is a short example of the usefulness of the "do" command:  If you have a variable x with a value of "field id 1", then you can say in your script,
  16.  
  17. get line 1 of x 
  18.  
  19. What you would get in this instance is the words "field id 1", the text that was in the variable x. In order to get what you really wanted, namely the first line of field id 1, you must issue a "do" command like the following:
  20.  
  21. do "get line 1 of " & x
  22.  
  23. ‚Ä¢ 3) Be aware that when you create a new card, the openCard message gets sent before the newCard message.
  24.  
  25. ‚Ä¢ 4) Developer tip:  Test your stacks at every userlevel. This is important since you will probably develop at userLevel 5, which will work fine until a user is in browse mode.  A typical example of this problem is if you have a DoMenu "Copy Card" in your script. This will cause an error at the lowest userLevels which do not have that menu choice. A workaround to this is to, on openstack,  put the current userLevel  into a variable, and then set userLevel to 5.  Make sure you set it back to the previous userLevel when you leave your application. 
  26.  
  27. ‚Ä¢ 5) If you try to go to card foo, and there is no card named foo, HyperCard will not make a fuss.  However, you can find out that HyperCard has not found the card by checking "the result".  "No such card" is "the result" if the card is not found.
  28.  
  29. go card foo
  30. if the result is "no such card"
  31. then answer "Card not found"
  32.  
  33. ‚Ä¢ 6) A returnKey handler intercepts the returnKey when it is hit in the message box, whether there's a message in the message box or not.  So when you're using a returnKey handler, take into account that the user may well be sending a message through the message box. I found that I had to look to see if the msg was empty before I did my normal returnKey handler, since I didn't want the returnKey handler to execute if the user was sending another message.  The same is true for an enterKey handler.
  34.  
  35. ‚Ä¢ 7) When you hit the grave character in HyperCard, you normally "go back" to the last card you were on. If you wanted a grave character, however, you can type Option-Grave-Spacebar in Geneva 12.  For fun, try Shift-Option Grave in Geneva 12.  (It gives you a little bunny rabbit in the field. With Geneva 14 you get a bird, with Geneva 18 you get a sheep, and with Geneva 20 you get a Macintosh computer.)
  36.  
  37. ‚Ä¢ 8) Here are some button ideas:
  38. This first button idea is a working radio card button.  The radio button checks to see if there are any more radio buttons on, since only one radio button should be on at a time.  Put the following script in a button. Set the style to radio button and autoHighliting to true in the button info dialog box.  The script  checks first to see if the button which was clicked on is highlited. If it is highlited, nothing happens, since a series of radio buttons should always have at least one button on.  If the button is not highlited, then this script hilites it and turns off all the rest of the buttons on the card.  This script assumes that you only have one series of radio buttons on each card, and that all of them are card buttons. 
  39.   
  40. on mouseUp
  41.   if not the highlite of me then
  42.     repeat with x = 1 to the number of buttons
  43.       if the style of button x is "radioButton" then
  44.         if the highlite of button x then
  45.           set the highlite of button x to false
  46.        end if
  47.       end if
  48.     end repeat
  49.     set the highlite of me to true
  50.   end if
  51.  end mouseUp
  52.  
  53. The second button idea is a working check box.  All the check box does is go on or off.  I found it very difficult to figure out that to get a check box to go on or off, you had to click the autohighlite feature in the button info dialog. 
  54.  
  55. ‚Ä¢ 9) If your HyperCard home card doesn't look just like it does in the manual, then you need Times 18 font in your system so that the words 
  56. "HOME CARD" will appear in the proper font.
  57.  
  58. ‚Ä¢ 10) There is an easy way to append to a file in HyperTalk.  Read until it is empty, then do your write command.
  59. Ô£ø
  60.  
  61.  
  62. -- part contents for background part 17
  63. ----- text -----
  64. HyperCard
  65. PowerTips
  66. Seven
  67.  
  68. -- part contents for background part 18
  69. ----- text -----
  70.  
  71.  
  72.  
  73. ‚Ä¢ by
  74. Phil Wyman 
  75.  
  76. -- part contents for background part 19
  77. ----- text -----
  78. volume 1 ‚Ä¢  number  7  ‚Ä¢  card 3  ‚Ä¢